<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql_log')->create('log_cbgame', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('通知研发发货日志');

            $table->increments('id');
            $table->integer('create_time')->comment('生成时间')->unsigned()->default(0);
            $table->char('trade_no', 32)->comment('订单号')->default('');
            $table->string('game_trade_no', 64)->comment('游戏方交易订单号')->default('');
            $table->integer('game_id')->comment('哪款游戏')->unsigned()->default(0);
            $table->string('url', 1000)->comment('请求url')->default('');
            $table->string('ret', 125)->comment('返回结果')->default('');

            $table->index('create_time');
            $table->index('trade_no');
            $table->index('game_trade_no');
            $table->index('game_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysql_log')->dropIfExists('log_cbgame');
    }
};
